/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Journal = app.model.define('journal', {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      autoIncrement: true,
      primaryKey: true
    },
    Ip: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    Url: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    Source: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    Type: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    Submit: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    Agent: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    State: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '1'
    },
    Err: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: false
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: false
    }
  }, {
    tableName: 'journal'
  });

  Journal.associate = function() {

  }

  return Journal;
};
